<template>
	<view class="content">
		<view class="top">
			<view class="box">
				<view class="withdrawallist">
					<view class="name-box flex-box">
						<view class="left-box">
							姓名
						</view>
						<view class="rigft-box">
							{{withdrawInfo.name}}
						</view>
					</view>
					<view class="name-box flex-box">
						<view class="left-box">
							申请金额
						</view>
						<view class="rigft-box">
							{{withdrawInfo.money}}
						</view>
					</view>
					<view class="name-box flex-box">
						<view class="left-box">
							手续费
						</view>
						<view class="rigft-box">
							{{withdrawInfo.commission}}
						</view>
					</view>
					<view class="name-box flex-box">
						<view class="left-box">
							到账金额
						</view>
						<view class="rigft-box">
							{{withdrawInfo.final_money}}
						</view>
					</view>
					<view class="name-box flex-box">
						<view class="left-box">
							提现方式
						</view>
						<view class="rigft-box">
							{{withdrawInfo.type==1?'支付宝':withdrawInfo.type==2?'微信':'银行卡'}}
						</view>
					</view>
					<view class="name-box flex-box" v-if="withdrawInfo.type!=3">
						<view class="left-box">
							{{withdrawInfo.type==1?"支付宝收款码":"微信收款码"}}
						</view>
						<view class="rigft-box">
							<u--image :showLoading="true" :src="withdrawInfo.qrcode_url" width="300rpx" height="300rpx"></u--image>
						</view>
					</view>
					<template v-else>
						<view class="name-box flex-box">
							<view class="left-box">
								收款银行
							</view>
							<view class="rigft-box">
								{{withdrawInfo.bank_open}}
							</view>
						</view>
						<view class="name-box flex-box">
							<view class="left-box">
								收款账号
							</view>
							<view class="rigft-box">
								{{withdrawInfo.bank_card}}
							</view>
						</view>
						<view class="name-box flex-box">
							<view class="left-box">
								银行卡绑定手机
							</view>
							<view class="rigft-box">
								{{withdrawInfo.mobile}}
							</view>
						</view>
					</template>
					<view class="name-box flex-box" style="border: none;">
						<view class="left-box">
							申请时间
						</view>
						<view class="rigft-box">
							{{withdrawInfo.create_time}}
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				paging: {
					page: 1,
					limit: 10,
				},
				total: null,
				withdrawInfo: {},
				withdraw_id:''
			}
		},
		onPullDownRefresh() {
			uni.startPullDownRefresh({
				success: () => this.refresh(),
				complete: () => uni.stopPullDownRefresh()
			})
		},
		onLoad(id) {
			this.withdraw_id = id
			this.getWithdrawDetail()
		},
		methods: {
			getWithdrawDetail(){
				let params={
					withdraw_id: this.withdraw_id.id
				}
				console.log(params);
				this.$api.withdrawDetail(params).then(res => {
					console.log(res);
					this.withdrawInfo = res.data
				})
			},
			// 刷新列表
			refresh() {
				this.getWithdrawDetail()
			},
		}
	}
</script>

<style scoped lang="scss">
	.top {
		padding-top: 20rpx
	}

	.content {
		background: #F5F5F5;
		min-height: 100vh;
		z-index: -1;

		.box {
			padding: 0 30rpx;
		}
		.withdrawallist {
			padding: 16rpx 30rpx;
			background: #FFFFFF;
		}
	}
	.flex-box{
		display: flex;
		justify-content: space-between;
		padding: 32rpx 0;
		border-bottom: 1rpx solid #dfdfdf;
	}
	
</style>